<template>
  <div class="download-manage-top">
    <dialog-title />
    <div
      class="close-window _no_drag_area"
      @click="closeWindow"
    >
      <svg-icon
        icon-class="close-window"
        :size="24"
      />
    </div>
  </div>
</template>

<script setup lang="ts">
import { invokeAsyncAPi } from '@/utils/xz-fn'
import { useDownloadManageWindow } from '@/stores/download-manage-window'
import { storeToRefs } from 'pinia'

const downloadManageWindowStore = useDownloadManageWindow()
const { masterWindowId } = storeToRefs(downloadManageWindowStore)
const closeWindow = async () => {
  invokeAsyncAPi('fq_NotifyWebMessageEx', masterWindowId.value, 'close-fake-download-dialog');
  await invokeAsyncAPi('fq_NotifyWebMessageEx', masterWindowId.value, 'close-download-finish-window')
  invokeAsyncAPi('jsMsg_SetWndStatus', 0)
}
</script>

<style scoped lang="scss">
.download-manage-top{
  position: absolute;
  left:0;
  top:0;
  right:0;
  height:46px;
  display: flex;
  align-items: center;
  padding:0 14px ;
  justify-content: space-between;
  .close-window{
    cursor: pointer;
  }
}
</style>